#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
int main()
{
	int x=5,y=5;
    int i,j;
    int fire=0;
    char ch;
    int nx=5;
    int score=0;
    int iskilled=0;
    
	while(1)
    {
    	system("CLS");
    	
    	if(iskilled == 0)
    	{
    		for(j=1;j<=nx;j++)
        	printf(" ");
        	printf("+\n");
		}
    	
    	if(fire ==0)
    	{
    		for(j=1;j<=y;j++)
    		printf("\n");
		}
    	else
    	{
    		for(j=1;j<=y;j++)
    		{
    			for(i=1;i<=x+2;i++)
    			printf(" ");
    			printf("|\n");
			}
        	fire=0;
		}
		if((x+2) == nx && ch == ' ')
		{
			fire = 0;
			iskilled=1;
			score++;
		}
		else
		iskilled=0;
		
    	for(j=1;j<=x;j++)
        printf(" ");
        printf("  *  \n");
    	for(j=1;j<=x;j++)
        printf(" ");
        printf("*****\n");
    	for(j=1;j<=x;j++)
    	printf(" ");
        printf(" * * \n");
		printf("score:%d",score);
    	ch = getch();
    	if(ch == 'w')
    	y--;
    	if(ch == 'a')
    	x--;
    	if(ch == 's')
    	y++;
   		if(ch == 'd')
   		x++;
   		if(ch == ' ')
   		fire=1;
		}
		
	return 0;
}
